#ifndef __SERIAL_H
#define __SERIAL_H

#ifdef __cplusplus
 extern "C" {
#endif
   
#include "System.h"

#if ENABLE_CMDUSART

#include "SysFifo.h"

#define CMD_MAX          1024

typedef struct{
    Fifo_T	fifo;
	uint8_t	buffer[CMD_MAX];
}UartBuff_T;
extern UartBuff_T	g_cmdBuff;

extern	int 	Serial_SendArray(uint8_t *_buff,uint16_t _len);
extern	void 	Serial_IPCInit(void);
extern	void 	Serial_Init(void);

static 	void 	CmdBuff_Init(void);
static 	uint8_t CmdBuff_InserData(UartBuff_T *_uartBuf,uint8_t _data);
static 	uint8_t CmdBuff_GetData(UartBuff_T *_uartBuf,uint8_t *_data);
static 	uint8_t CmdBuff_GetPosData(UartBuff_T *_uartBuf,uint16_t _pos);

#endif

#ifdef __cplusplus
}
#endif
#endif

